package com.example.szh.mvp.view.user;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

import com.example.szh.R;

public class NickNameActivity extends AppCompatActivity implements View.OnClickListener {

    private Button saveBnt;
    private EditText nikeName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_nick_name);
        initView();
    }

    private void initView() {
        saveBnt = (Button) findViewById(R.id.save_bnt);
        nikeName = (EditText) findViewById(R.id.nikeName);
        saveBnt.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v.getId()==R.id.save_bnt){
            if (nikeName.getText().toString()!=null){
                Intent intent = new Intent();
                intent.putExtra("nikename", nikeName.getText().toString());
                setResult(102, intent);
                finish();
            }
        }
    }
}